import { useEffect } from "react"
import {getKindList} from '../api/kind'
import { useSelector, useDispatch } from "react-redux"
import { changeKindList } from "../store/modules/kind"
const Kind = ()=>{

    const dis = useDispatch()

    const kindList = useSelector(state => state.kind.kindList)

    useEffect(()=>{
        getKindList().then(res => {
            dis(changeKindList(res.data.data))
        })
    }, [])

    return (<div>
        {
            kindList &&
            kindList.map(item => {
                return <p key={item}>{item}</p>
            })
        }
    </div>)
}

export default Kind